package com.engine.salary.entity.salarysob.param;

import com.engine.salary.util.valid.DataCheck;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * @description: 薪资账套薪资项目保存参数
 * @author: xiajun
 * @modified By: xiajun
 * @date: Created in 11/25/21 2:43 PM
 * @version:v1.0
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SalarySobItemSaveParam {

    //薪资账套id
    @DataCheck(require = true, message = "薪资账套的ID不允许为空")
    private Long salarySobId;

    //薪资账套薪资项目保存参数-员工信息字段
    @DataCheck(require = true, message = "员工信息字段不能为空")
    private List<SalarySobEmpFieldParam> empFields;

    //薪资账套薪资项目保存参数-薪资项目分组")
    private List<SalarySobItemGroupParam> itemGroups;

    //薪资账套薪资项目保存参数-薪资项目（未分类）")
    private List<SalarySobItemParam> items;

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    //"薪资账套薪资项目保存参数-员工基本信息字段")
    public static class SalarySobEmpFieldParam {

        //主键id
        private Long id;

        //员工基本信息字段")
        private String fieldId;

        //显示顺序")
        private Integer sortedIndex;

        private Boolean canDelete;
    }

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    //"薪资账套薪资项目保存参数-薪资项目")
    public static class SalarySobItemParam {

        //主键id")
        private Long id;

        //薪资项目的id")
        private Long salaryItemId;

        //显示顺序")
        private Integer sortedIndex;

        //公式")
        private Long formulaId;

        //该分类是否隐藏（0不隐藏，1隐藏）
        private Long itemHide;

        private Boolean canDelete;

        // 默认值
        private String defaultValue;

        /**
         * 进位规则
         */
        private Integer roundingMode;

        /**
         * 保留小数位数
         */
        private Integer pattern;

        /**
         * 取值方式
         */
        private Integer valueType;

    }

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    //"薪资账套薪资项目保存参数-薪资项目分类")
    public static class SalarySobItemGroupParam {

        //主键id
        private Long id;

        //分类名称"
        private String name;

        //显示顺序
        private Integer sortedIndex;

        //分类下的薪资项目
        private List<SalarySobItemParam> items;

        //该分类是否隐藏（0不隐藏，1隐藏）
        private Long itemHide;
    }
}
